.class Lcom/example/m6wmr/AddCouponActivity$1;
.super Landroid/os/Handler;
.source "AddCouponActivity.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/example/m6wmr/AddCouponActivity;->onCreate(Landroid/os/Bundle;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/example/m6wmr/AddCouponActivity;


# direct methods
.method constructor <init>(Lcom/example/m6wmr/AddCouponActivity;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    .line 77
    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lcom/example/m6wmr/AddCouponActivity$1;)Lcom/example/m6wmr/AddCouponActivity;
    .locals 1

    .prologue
    .line 77
    iget-object v0, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    return-object v0
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 13
    .param p1, "msg"    # Landroid/os/Message;

    .prologue
    const/4 v12, 0x0

    .line 81
    invoke-super {p0, p1}, Landroid/os/Handler;->handleMessage(Landroid/os/Message;)V

    .line 82
    iget v8, p1, Landroid/os/Message;->what:I

    packed-switch v8, :pswitch_data_0

    .line 148
    :cond_0
    :goto_0
    return-void

    .line 85
    :pswitch_0
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    iget-object v9, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->et_coupon_number:Landroid/widget/EditText;
    invoke-static {v9}, Lcom/example/m6wmr/AddCouponActivity;->access$1(Lcom/example/m6wmr/AddCouponActivity;)Landroid/widget/EditText;

    move-result-object v9

    invoke-virtual {v9}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v9

    invoke-interface {v9}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v9

    const-string v10, "%"

    const-string v11, ""

    invoke-virtual {v9, v10, v11}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    const-string v10, " "

    const-string v11, ""

    invoke-virtual {v9, v10, v11}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Lcom/example/m6wmr/AddCouponActivity;->access$2(Lcom/example/m6wmr/AddCouponActivity;Ljava/lang/String;)V

    .line 86
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    iget-object v9, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->et_coupon_code:Landroid/widget/EditText;
    invoke-static {v9}, Lcom/example/m6wmr/AddCouponActivity;->access$3(Lcom/example/m6wmr/AddCouponActivity;)Landroid/widget/EditText;

    move-result-object v9

    invoke-virtual {v9}, Landroid/widget/EditText;->getText()Landroid/text/Editable;

    move-result-object v9

    invoke-interface {v9}, Landroid/text/Editable;->toString()Ljava/lang/String;

    move-result-object v9

    const-string v10, "%"

    const-string v11, ""

    invoke-virtual {v9, v10, v11}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    const-string v10, " "

    const-string v11, ""

    invoke-virtual {v9, v10, v11}, Ljava/lang/String;->replace(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Lcom/example/m6wmr/AddCouponActivity;->access$4(Lcom/example/m6wmr/AddCouponActivity;Ljava/lang/String;)V

    .line 88
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    invoke-virtual {v8}, Lcom/example/m6wmr/AddCouponActivity;->isNull()Z

    move-result v8

    if-eqz v8, :cond_0

    .line 90
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    const-string v9, "userInfo"

    invoke-virtual {v8, v9, v12}, Lcom/example/m6wmr/AddCouponActivity;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v4

    .line 91
    .local v4, "sharedPreferences":Landroid/content/SharedPreferences;
    const-string v8, "uid"

    const-string v9, ""

    invoke-interface {v4, v8, v9}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v6

    .line 92
    .local v6, "uid":Ljava/lang/String;
    const-string v8, "pass"

    const-string v9, ""

    invoke-interface {v4, v8, v9}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 94
    .local v3, "pwd":Ljava/lang/String;
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->context:Landroid/content/Context;
    invoke-static {v8}, Lcom/example/m6wmr/AddCouponActivity;->access$5(Lcom/example/m6wmr/AddCouponActivity;)Landroid/content/Context;

    move-result-object v8

    const-string v9, "\u6b63\u5728\u63d0\u4ea4\u6570\u636e"

    const-string v10, "\u6dfb\u52a0\u4f18\u60e0\u5238\u4e2d....."

    invoke-static {v8, v9, v10}, Lmyapp/Util;->showDialog(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    .line 96
    new-instance v8, Ljava/lang/StringBuilder;

    iget-object v9, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->m:Lmyapp/MyApp;
    invoke-static {v9}, Lcom/example/m6wmr/AddCouponActivity;->access$6(Lcom/example/m6wmr/AddCouponActivity;)Lmyapp/MyApp;

    move-result-object v9

    invoke-virtual {v9}, Lmyapp/MyApp;->getWebConfig()Ljava/lang/String;

    move-result-object v9

    invoke-static {v9}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v9, "/index.php?ctrl=app&source=1&action="

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    .line 97
    const-string v9, "savejuan&datatype=json&uid="

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    const-string v9, "&pwd="

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    const-string v9, "&card="

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    iget-object v9, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->couponNumber:Ljava/lang/String;
    invoke-static {v9}, Lcom/example/m6wmr/AddCouponActivity;->access$7(Lcom/example/m6wmr/AddCouponActivity;)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    const-string v9, "&cardpwd="

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    iget-object v9, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->couponcode:Ljava/lang/String;
    invoke-static {v9}, Lcom/example/m6wmr/AddCouponActivity;->access$8(Lcom/example/m6wmr/AddCouponActivity;)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    .line 96
    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    .line 98
    .local v7, "url":Ljava/lang/String;
    new-instance v8, Ljava/lang/Thread;

    new-instance v9, Lcom/example/m6wmr/AddCouponActivity$1$1;

    invoke-direct {v9, p0, v7}, Lcom/example/m6wmr/AddCouponActivity$1$1;-><init>(Lcom/example/m6wmr/AddCouponActivity$1;Ljava/lang/String;)V

    invoke-direct {v8, v9}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    .line 106
    invoke-virtual {v8}, Ljava/lang/Thread;->start()V

    goto/16 :goto_0

    .line 111
    .end local v3    # "pwd":Ljava/lang/String;
    .end local v4    # "sharedPreferences":Landroid/content/SharedPreferences;
    .end local v6    # "uid":Ljava/lang/String;
    .end local v7    # "url":Ljava/lang/String;
    :pswitch_1
    invoke-static {}, Lmyapp/Util;->dismisDialog()V

    .line 114
    :try_start_0
    new-instance v2, Lorg/json/JSONObject;

    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->result:Ljava/lang/String;
    invoke-static {v8}, Lcom/example/m6wmr/AddCouponActivity;->access$10(Lcom/example/m6wmr/AddCouponActivity;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v2, v8}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 117
    .local v2, "object":Lorg/json/JSONObject;
    const-string v8, "error"

    invoke-virtual {v2, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    const-string v9, "true"

    invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 119
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->context:Landroid/content/Context;
    invoke-static {v8}, Lcom/example/m6wmr/AddCouponActivity;->access$5(Lcom/example/m6wmr/AddCouponActivity;)Landroid/content/Context;

    move-result-object v8

    const-string v9, "\u6dfb\u52a0\u5931\u8d25"

    const/4 v10, 0x0

    invoke-static {v8, v9, v10}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v8

    invoke-virtual {v8}, Landroid/widget/Toast;->show()V

    .line 122
    :cond_1
    const-string v8, "error"

    invoke-virtual {v2, v8}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    const-string v9, "false"

    invoke-virtual {v8, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_0

    .line 124
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->context:Landroid/content/Context;
    invoke-static {v8}, Lcom/example/m6wmr/AddCouponActivity;->access$5(Lcom/example/m6wmr/AddCouponActivity;)Landroid/content/Context;

    move-result-object v8

    const-string v9, "\u6dfb\u52a0\u6210\u529f"

    const/4 v10, 0x0

    invoke-static {v8, v9, v10}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v8

    invoke-virtual {v8}, Landroid/widget/Toast;->show()V

    .line 126
    const-string v8, "addcouponresout--------"

    invoke-virtual {v2}, Lorg/json/JSONObject;->toString()Ljava/lang/String;

    move-result-object v9

    invoke-static {v8, v9}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 128
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    # getter for: Lcom/example/m6wmr/AddCouponActivity;->context:Landroid/content/Context;
    invoke-static {v8}, Lcom/example/m6wmr/AddCouponActivity;->access$5(Lcom/example/m6wmr/AddCouponActivity;)Landroid/content/Context;

    move-result-object v8

    const-string v9, "userInfo"

    const/4 v10, 0x0

    invoke-virtual {v8, v9, v10}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v5

    .line 129
    .local v5, "spPreferences":Landroid/content/SharedPreferences;
    const-string v8, "juancount"

    const-string v9, "0"

    invoke-interface {v5, v8, v9}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v8

    invoke-static {v8}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/Integer;->intValue()I

    move-result v1

    .line 131
    .local v1, "juan":I
    invoke-interface {v5}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v8

    const-string v9, "juancount"

    add-int/lit8 v10, v1, 0x1

    invoke-static {v10}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v10

    invoke-interface {v8, v9, v10}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    move-result-object v8

    invoke-interface {v8}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 135
    iget-object v8, p0, Lcom/example/m6wmr/AddCouponActivity$1;->this$0:Lcom/example/m6wmr/AddCouponActivity;

    invoke-virtual {v8}, Lcom/example/m6wmr/AddCouponActivity;->finish()V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    goto/16 :goto_0

    .line 139
    .end local v1    # "juan":I
    .end local v2    # "object":Lorg/json/JSONObject;
    .end local v5    # "spPreferences":Landroid/content/SharedPreferences;
    :catch_0
    move-exception v0

    .line 140
    .local v0, "e":Lorg/json/JSONException;
    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    goto/16 :goto_0

    .line 82
    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method
